package ooday03;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/2/22
 **/
public class Text {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        dogs[0]=new Dog("小黄",2,"白");
        dogs[1]=new Dog("小黑",3,"绿");
        dogs[2]=new Dog("小白",1,"黑");
        System.out.println(dogs[0].name);
        dogs[1].age=4;
        dogs[2].swim();
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }
        Chick[] chicks = new Chick[3];
        chicks[0]=new Chick("小绿",2,"白");
        chicks[1]=new Chick("小白",3,"绿");
        chicks[2]=new Chick("小花",1,"黑");
        System.out.println(chicks[0].name);
        chicks[1].age=4;
        chicks[2].layEggs();
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].eat();
        }
        Fish[] fish = new Fish[3];
        fish[0]=new Fish("小金",2,"白");
        fish[1]=new Fish("大绿",3,"绿");
        fish[2]=new Fish("中黄",1,"黑");
        System.out.println(fish[0].name);
        fish[1].age=4;
        fish[2].eat();
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].eat();
        }


    }
}
